package com.ss.android.article.base.app;

import android.app.Activity;
import android.content.DialogInterface;
import android.content.SharedPreferences;
import com.bytedance.common.utility.b.ThreadPlus;
import com.bytedance.common.utility.c.SharedPreferenceCompat;
import com.ss.android.common.lib.MobClickCombiner;
import com.ss.android.common.location.LocationUploadHelper;
import com.ss.android.common.location.h;

final class f implements DialogInterface.OnClickListener {
    private final AppData d;
    private final Activity a;
    private final String b;
    private final LocationUploadHelper c;

    f(AppData arg1, Activity arg2, String arg3, LocationUploadHelper arg4) {
        this.d = arg1;
        this.a = arg2;
        this.b = arg3;
        this.c = arg4;

    }

    public final void onClick(DialogInterface arg7, int arg8) {
        switch(arg8) {
            case -2: {
                this.c.d();
                break;
            }
            case -1: {
                MobClickCombiner.onEvent(this.a, "pop", "locate_change_category_open");
                AppData v0 = this.d;
                String v1 = this.b;
                if(!android.support.design.a.isTextEmpty(v1)) {
                    v0.localCityName = v1;
                    SharedPreferences.Editor v1_1 = v0.mContext.getSharedPreferences("app_setting", 0).edit();
                    v1_1.putString("local_city_name", v0.localCityName);
                    SharedPreferenceCompat.commit(v1_1);
                }

                new ThreadPlus(new h(this.c, this.b), "user_loc_uplode", true).start();
                android.support.design.a.showToast(this.a, this.a.getString(com.ss.android.article.browser.R.string.p2, new Object[]{this.b}), this.a.getResources().getDrawable(com.ss.android.article.browser.R.drawable.doneicon_popup_textpage));
                break;
            }
        }
    }
}

